(function($) {
$(function() {

	// Lightbox
	$("a.zoom").prettyPhoto({
		hook: 'data-rel',
		social_tools: false,
		theme: 'pp_woocommerce',
		horizontal_padding: 20,
		opacity: 0.8,
		deeplinking: false
	});
	$("a[data-rel^='prettyPhoto']").prettyPhoto({
		hook: 'data-rel',
		social_tools: false,
		theme: 'pp_woocommerce',
		horizontal_padding: 20,
		opacity: 0.8,
		deeplinking: false
	});

	var mainImg = $('.woocommerce-main-image').attr('href');

	$( ".hover-show" )
	  .mouseenter(function() {
		  var url = $(this).attr('href');
		  $('.woocommerce-main-image').attr('href', url);
		  $('.woocommerce-main-image img').attr('src', url);
	  })
	  .mouseleave(function() {
	    	$('.woocommerce-main-image').attr('href', mainImg);
		    $('.woocommerce-main-image img').attr('src', mainImg);
	  }
	  
	 );

	 $( ".hover-show" ).click(function(){
	  	$('.woocommerce-main-image').click();
	  	return false;
	  })

});
})(jQuery);